Cisco CLI Error: % Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN
When does this error message appear?
This error message appears while attempting to configure an IP address on a subinterface of a Layer 3 interface.
What does this error message mean?
What is the most common occurence of this error?
After a new subinterface has been created we may be tempted to configure an IP address for the subinterface right away. However, we cannot configure an IP address on a subinterface without first specifying a VLAN ID for the subinterface.
Example
% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.
In the example above, a new subinterface (gi0/0.1) is created. Immediately after creating the subinterface, we attempt to configure an IP address (10.0.0.1 /24) on the subinterface.
The error message indicates that we need to assign the subinterface to a VLAN before we can configure an IP address on it.
Solution
The solution to this error is to assign the subinterface to the desired VLAN first, before configuring an IP address on it. We can use the encapsulation command to assign the interface to the desired VLAN.
For our example, we will assign subinterface gi0/0.1 to VLAN 10 using the command: encapsulation dot1q 10. Once the subinterface is assigned to a VLAN, we are then able to configure an IP address on the subinterface.
% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.
VLANs, trunking, inter-vlan routing and subinterfaces are covered in detail the following interactive course: Course 5 - VLANs & Trunks on this website.
Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: Workshops (Login required).
Read how to use the device simulators on this website here: Workshops - General Instructions